<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript" src="<s:url value="/js/translator.js"/>"></script>

<s:form id="formEdit" cssClass="tableEdit">
    <tr>
        <th colspan="4" class="tableTitle">
            <h5>Translator</h5>
        </th>
    </tr>

    <s:hidden name="id" value="%{translator.id}"/>
    <s:hidden name="address.id" value="%{translator.address.id}"/>

    <s:textfield label="Name" name="name" value="%{translator.name}"/>
    <s:textfield label="Surname" name="surname" value="%{translator.surname}"/>
    <s:textfield label="Translation Company" name="translationCompany" value="%{translator.translationCompany}"/>

    <s:hidden label="City" name="address.city" id="addressCity" value="%{translator.address.city}"/>
    <s:hidden label="Province" name="address.province" id="addressProvince" value="%{translator.address.province}"/>
    <s:hidden label="Country" name="address.country" id="addressCountry" value="%{translator.address.country}"/>

    <s:if test="%{translator.id != null}">
        <s:include value="../address/addressedit.jsp"/>
    </s:if>
    <s:else>
        <s:include value="../address/addressview.jsp"/>
    </s:else>

    <s:textfield label="E-Mail" name="email" id="email" value="%{translator.email}"/>
    <s:include value="../address/phone.jsp"/>
    <s:hidden name="address.phone" id="addressPhone" value="%{translator.phone}"/>

    <tr>
        <td>
            <label>Mobile Phone: </label><img class="imgInfo" src="<s:url value="/images/info.png"/>"/>
        </td>
        <td>
            <s:textfield theme="simple" name="mobilePhone" value="%{translator.mobilePhone}"/>
        </td>
    </tr>
    <tr>
        <td colspan="2" class="centeredButtons"><s:submit value="Save" id="save" action="save" onclick="beforeSave();validate()" theme="simple"/>
        </td>
    </tr>

</s:form>
<script type="text/javascript">
    $("#otherCity").parent().parent().hide();
</script>

<script type="text/javascript">
    $('#translator').css({"color":"#EE5102","fontWeight":"bold"});
</script>
